
<!DOCTYPE html>
<html ng-app="zqapp">
<head>
  <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
  <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
  <title>learnforangular</title>
  <script src="angular-1.5.6/angular.js"></script>
  <style type="text/css">
    .btn{
      width:500px;
    }

  </style>
</head>
<body>

  <script type="text/ng-template" id="temp1">
    <div ng-controller="tempcontroller">
      <p>
        <button class="btn">121121</button>
      </p>
      <p>
         <h1>模板</h1>
      </p>
      <p>
        姓名：<span ng-click="tclick()">{{name}}</span>
      </p>
      <p>
        邮箱：{{email}}
      </p>
    </div>
  </script>
  
  <div ng-include src="'temp1'">
    <p>
      模板外的p标签
    </p>
  </div>

  <script type="text/javascript">
    angular.module('zqapp',[]).controller('tempcontroller',
    function($window,$scope){
      $scope.name = 'yourfather';
      $scope.email = '1111@qqq.com';
      $scope.tclick = function(){
        $scope.name = $scope.name + "1";
      }
    });
  </script>
  <script type="text/javascript">
    // var myapp = ;

    // myapp.controller('zqcontroller',function($window,$scope){
    //   $scope.name = 'yourfather';
    //   $scope.email = '1111@qqq.com';
    //   $scope.tclick = function(){
    //     $scope.name = $scope.name + "1";
    //   }
    // });
  </script>
</body>

</html>
